package IOStreamStudy.fileReader;

import org.junit.Test;

import java.io.FileReader;
import java.io.IOException;

/**
 * 读取字符流
 * */
public class FileReaderDemo {

    @Test
    public void FileReader01() throws IOException {
        String filePath = "D:\\all_projects\\java_projects\\java_ij\\springMVC" +
                "\\NetWork\\src\\cn\\usts\\edu\\IOStreamStudy\\fileReader\\a.txt";
        FileReader fileReader = new FileReader(filePath);
        char[] buffer = new char[8];
        int len;
        while ((len = fileReader.read(buffer))!=-1){
            System.out.println(new String(buffer,0,len));
        }
        fileReader.close();
    }


}
